package VWorldGameStudio;

import java.io.Serializable;
import java.util.ArrayList;

public class FCBattleEventOrder implements Serializable {
    /**
     * 1.指令类型有
     * 对话指令，操纵角色指令，属性指令,结束转剧情指令
     * <p>
     * 对话指令-指定回合对话，以及 战斗结束对话
     * 操纵角色指令{
     * 1.指定回合谁加入战斗
     * 2.指定回合怪物只打某某
     * 3.指定回合操纵怪物/人物使用xxx
     * 4.指定回合谁离场（怪物/人物）
     * }
     * 属性指令{
     * 1.给xx加血量，（不死）
     * }
     * 结束转剧情指令
     * whtichRound = -1 表示战斗结束
     */
    public static final int EventOrderTypeSay = 1;
    public static final int EventOrderTypeCtrl = 2;
    public static final int EventOrderTypeShuxing = 3;
    public static final int EventOrderTypeEndPlot = 4;
    public static final int EventOrderTypeCtrl_Battle_NPC_In = 1;//npc加入战斗
    public static final int EventOrderTypeCtrl_Battle_NPC_Out = 2;
    public static final int EventOrderTypeCtrl_Battle_M_In = 3;//
    public static final int EventOrderTypeCtrl_Battle_M_Out = 4;
    public static final int EventOrderTypeCtrl_Monster_Attack = 5;//回合怪物只打某某
    public static final int EventOrderTypeCtrl_Use_M_Item = 6;//怪物回合使用物品
    public static final int EventOrderTypeCtrl_Use_Npc_Item = 7;//回合使用物品

    public FCBattleEventOrder(int type) {
        eventOrderType = type;
    }

    public int eventOrderType = EventOrderTypeSay;
    //细节指令
    public int eventOrderDetail = 1;

    //第几个回合，直接是第几回合开始时执行指令 -1 是结束
    public int whtichRound = 0;

    //剧情id
    public String jumpPlotId;

    //对话Id
    public String battleSayTextId;

    //控制的怪物
    public String contrlMonsterId;

    //玩家不可以控制
    public String contrlNpc;

    //使用物品
    public String useItemId;

    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("type:" + eventOrderType);
        sb.append(" 回合:" + whtichRound);
        if (eventOrderType == 1) {
            sb.append(" 对话:" + battleSayTextId);
        } else if (eventOrderType == 2) {
            sb.append(" 操纵:");
            sb.append(" " + (contrlMonsterId != null&&!contrlMonsterId.equals("null")? contrlMonsterId : contrlNpc) + ":");
            switch (eventOrderDetail) {
                case 1:
                case 3:
                    sb.append("加入战斗");
                    break;
                case 2:
                case 4:
                    sb.append("退出战斗");
                    break;
                case 5:
                    sb.append("怪物只攻击对象");
                    break;
                case 6:
                case 7:
                    sb.append("使用物品 ：" + useItemId);
                    break;
            }
        } else if (eventOrderType == 3) {
            sb.append(" 属性:");

        } else if (eventOrderType == 4) {
            sb.append(" 结尾跳转剧情:" + jumpPlotId);
        }
        return sb.toString();
    }

}
